package route

import (
	"github.com/gin-gonic/gin"
	"github.com/vueadmin/app/admin/internal/handler/log"
	"github.com/vueadmin/app/admin/internal/middle"
	"github.com/vueadmin/app/admin/internal/svc"
	"github.com/vueadmin/middleware"
	"github.com/vueadmin/utils/conv"
)

type Log struct{}

/**
 * @description(日志管理路由)
 * @buildcode(true)
*/
func (Log) RegisterRoute(route *gin.Engine, svcCtx *svc.ServiceContext) {
	r := route.Group(svcCtx.Config.Prefix)
	r.Use(middleware.JwtVerifyMiddleware(conv.String(svcCtx.Config.Jwt)), middle.NewBeforActionMiddleware(svcCtx).Handle())

	r.POST("/Log/index", func(c *gin.Context) {log.GetPageList(c, svcCtx)})               //数据列表
	r.POST("/Log/delete", func(c *gin.Context) {log.Delete(c, svcCtx)})               //删除
	r.POST("/Log/detail", func(c *gin.Context) {log.Detail(c, svcCtx)})               //查看详情
	r.POST("/Log/export", func(c *gin.Context) {log.Export(c, svcCtx)})               //导出
	r.POST("/Log/getFieldList", func(c *gin.Context) {log.GetFieldList(c, svcCtx)})               //查询列表
}

